//
//  ViewController.m
//  demoTableViewMutableSelected
//
//  Created by yuanweitiansheng on 17/4/12.
//  Copyright © 2017年 yuanweitiansheng. All rights reserved.
//

#import "ViewController.h"
#import "TableviewCellRound.h"
@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
{
    NSString* cell_Identifier;
}
@property (weak, nonatomic) IBOutlet UITableView *vc_List;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    cell_Identifier=@"identifier";
    [self.vc_List registerClass:[TableviewCellRound class]
         forCellReuseIdentifier:cell_Identifier];
    self.vc_List.rowHeight=80;
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - <UITableViewDataSource>
-(NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
    return 50;
}
-(UITableViewCell *)tableView:(UITableView *)tableView
        cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    TableviewCellRound* cell=[tableView dequeueReusableCellWithIdentifier:cell_Identifier];
    cell.textLabel.text=[NSString stringWithFormat:@"number:%zi",indexPath.row];
    cell.tintColor=[UIColor redColor];
    cell.imageView.image=[UIImage imageNamed:@"cry"];
    [cell tcChaneImageviewSize:CGSizeMake(60, 60)];
    return cell;
}
-(void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
#pragma mark -<UITableViewDelegate>
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
           editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleDelete|UITableViewCellEditingStyleInsert;
}
#pragma mark - method
- (IBAction)vc_Edit:(UIButton *)sender
{
    sender.selected=!(sender.selected);
    self.vc_List.editing=sender.selected;
}
- (IBAction)vc_SelectedRows:(UIButton *)sender
{
    NSLog(@"%@",[self.vc_List indexPathsForSelectedRows]);
}
@end
